﻿<%@ Page Title="" Language="C#" MasterPageFile="~/doanh_nghiep/DNAdminLayout.master" AutoEventWireup="true" CodeFile="bao_cao_ban_hang_thoi_gian.aspx.cs" Inherits="doanh_nghiep_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div class="block" id="block-tables">
<div class="content">
            <h2 class="title">
                &nbsp;<a href=bao_cao_ban_hang_thoi_gian.aspx>Thống kê theo tháng</a>
            </h2>
                <div class="inner">
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConnectionString="<%$ ConnectionStrings:babydealConnectionString %>" 
        
                        
                        SelectCommand="SELECT MONTH(mua_hang.ngay_gio_in_phieu) AS Expr2, YEAR(mua_hang.ngay_gio_in_phieu) AS Expr3, SUM(mua_hang.gia_goc) AS Expr1 FROM mua_hang INNER JOIN doanh_nghiep ON mua_hang.id = doanh_nghiep.id INNER JOIN khuyen_mai ON mua_hang.id_khuyen_mai = khuyen_mai.id AND doanh_nghiep.id = khuyen_mai.id_doanh_nghiep WHERE (doanh_nghiep.ten_dang_nhap = @ten_dn) GROUP BY MONTH(mua_hang.ngay_gio_in_phieu), YEAR(mua_hang.ngay_gio_in_phieu)">
        <SelectParameters>
            <asp:SessionParameter Name="ten_dn" SessionField="TenDangNhap" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CssClass="table" 
        DataSourceID="SqlDataSource1" Style="margin-right: 31px" CellPadding="4" PageSize="5" AlternatingRowStyle-CssClass="odd" RowStyle-CssClass="even">
<AlternatingRowStyle CssClass="odd"></AlternatingRowStyle>
        <Columns>
            <asp:BoundField DataField="Expr2" HeaderText="Tháng" 
                SortExpression="Expr2" ReadOnly="True" />
            <asp:BoundField DataField="Expr3" HeaderText="Năm" ReadOnly="True" 
                SortExpression="Expr3" />
            <asp:BoundField DataField="Expr1" HeaderText="Doanh số" ReadOnly="True" 
                SortExpression="Expr1" />
        </Columns>

<RowStyle CssClass="even"></RowStyle>
    </asp:GridView>
    </div>
    </div>
    </div>
</asp:Content>

